package com.block.datapush.service.apipush.utils;

import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;
import org.apache.commons.lang3.StringUtils;

/**
 * 互融智贷双授权
 */
public class HuRongZhiDaiSsqRateSsqUtil {


    public static Integer getSocialInsurance(String shebao) {
        if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb001.getValue(), shebao)) {
            return 1;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb002.getValue(), shebao)){
            return 2;
        }
        return 3;
    }

    public static Integer getGjj(String gongjijin) {
        if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj001.getValue(), gongjijin)) {
            return 1;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj002.getValue(), gongjijin)){
            return 2;
        }
        return 3;
    }

    public static Integer getCar(String car) {
        if (StrUtil.equals(BaseTypeInfoEnum.Car.car001.getValue(), car)) {
            return 1;
        }
        return 2;
    }

    public static Integer getHouse(String house) {
        if (StrUtil.equals(BaseTypeInfoEnum.House.hu001.getValue(), house)) {
            return 1;
        }else if (StrUtil.equals(BaseTypeInfoEnum.House.hu004.getValue(), house)){
            return 2;
        }
        return 3;
    }

    public static Integer getbaodan(String baodan) {
        if (StrUtil.equals(BaseTypeInfoEnum.Baoxian.bx001.getValue(), baodan)) {
            return 1;
        }
        return 2;
    }

    public static Integer getZhimaScore(String zhima) {
        if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm001.getValue(), zhima)) {
            return 0;
        } else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm002.getValue(), zhima)){
            return 599;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm003.getValue(), zhima)) {
            return 650;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm004.getValue(), zhima)) {
            return 700;
        }
        return 750;
    }

    public static Integer getJob(String job){
        if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz001.getValue(), job)) {
            return 1;
        } else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz002.getValue(), job)){
            return 3;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz004.getValue(), job)) {
            return 2;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz003.getValue(), job)) {
            return 4;
        }
        return 5;
    }

    public static Integer getXinyongka(String xyk){
        if (StrUtil.equals(BaseTypeInfoEnum.XinYongKa.xyk001.getValue(), xyk)) {
            return 1;
        }
        return 2;
    }

    public static Integer getXueli(String xueli){
        if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl001.getValue(), xueli) || StrUtil.equals(BaseTypeInfoEnum.XueLi.xl002.getValue(), xueli)) {
            return 3;
        }else if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl003.getValue(), xueli)) {
            return 4;
        }else if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl004.getValue(), xueli)) {
            return 5;
        }
        return 6;
    }

    public static Integer getShouru(String shouru){
        if (StrUtil.equals(BaseTypeInfoEnum.Shouru.sr001.getValue(), shouru)){
            return 5000;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Shouru.sr002.getValue(), shouru)){
            return 10000;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Shouru.sr003.getValue(), shouru)){
            return 20000;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Shouru.sr004.getValue(), shouru)){
            return 30000;
        }
        return 50000;
    }

    public static Integer getYongtu(String yongtu){
        if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt001.getValue(), yongtu)){
            return 1;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt004.getValue(), yongtu)){
            return 2;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt005.getValue(), yongtu)){
            return 4;
        }
        return 10;
    }

    public static String getReqIp(String ip){
        if (StringUtils.isNotEmpty(ip)){
            return ip;
        }
        return "127.0.0.1";
    }

    public static Integer getHuabei(String huabei){
        if (StrUtil.equals(BaseTypeInfoEnum.Huabei.hb001.getValue(),huabei)){
            return 1;
        }
        return 4;
    }

    public static Integer getBaitiao(String baitiao){
        if (StrUtil.equals(BaseTypeInfoEnum.Baitiao.bt001.getValue(),baitiao)){
            return 1;
        }
        return 4;
    }







}
